package net.hcdz.identity.util;

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;

public class MD5 {

    public static String EncoderByMd5(String str) throws NoSuchAlgorithmException, UnsupportedEncodingException{
        

        MessageDigest md5=MessageDigest.getInstance("MD5");
        String newstr = Base64.getEncoder().encodeToString(md5.digest(str.getBytes("utf-8")));
        return newstr;
    }
}
